function animation(obj, end, action) {
    clearInterval(obj.move);
    obj.move = setInterval(function () {
        obj.speed = (end - obj.offsetLeft) / 10;
        obj.speed = obj.speed < 0 ? Math.floor(obj.speed) : Math.ceil(obj.speed);
        if (obj.offsetLeft == end) {
            clearInterval(obj.move);
            // if (action) {
            //     action();
            // }
            action && action();
        }
        obj.style.left = obj.offsetLeft + obj.speed + 'px';
    }, 15);
}